<?php /*a:1:{s:63:"D:\phpweb\client-manage\application\admin\view\client\edit.html";i:1743690314;}*/ ?>
<!DOCTYPE html>

<html>



<head>

	<meta charset="utf-8">

	<title></title>

	<meta name="renderer" content="webkit">

	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

	<link rel="stylesheet" href="/public/static/layuiadmin/layui/css/layui.css" media="all">

	<link rel="stylesheet" href="/public/static/layuiadmin/style/admin.css" media="all">

	<style>
		.layui-form-label {
			width: 160px !important;
		}

		.layui-input-block {
			margin-left: 190px;
		}
	</style>

</head>



<body>

	<div class="layui-fluid">

		<div class="layui-card">

			<div class="layui-card-body" style="padding: 15px;">

				<form class="layui-form" method="post" lay-filter="component-form-group">

					<input type="hidden" name="id" value="<?php echo htmlentities($id); ?>">

					<div class="layui-form-item">
						<label class="layui-form-label">業界</label>
						<div class="layui-input-block">
							<select name="industry_id" lay-verify="required" lay-filter="industry_id" lay-search="">
								<option value="">業界</option>
								<?php if(is_array($industry) || $industry instanceof \think\Collection || $industry instanceof \think\Paginator): $i = 0; $__LIST__ = $industry;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
								<option value="<?php echo htmlentities($v['id']); ?>" <?php if($info['industry_id']==$v['id']): ?>selected<?php endif; ?>><?php echo htmlentities($v['title']); ?></option>
								<?php endforeach; endif; else: echo "" ;endif; ?>
							</select>
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">分類</label>
						<div class="layui-input-block">
							<select name="class_id" id="class_id" lay-verify="required" lay-filter="class_id"
								lay-search="">
								<option value="">分類</option>
								<?php if(is_array($class) || $class instanceof \think\Collection || $class instanceof \think\Paginator): $i = 0; $__LIST__ = $class;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
								<option value="<?php echo htmlentities($v['id']); ?>" <?php if($info['class_id']==$v['id']): ?>selected<?php endif; ?>><?php echo htmlentities($v['title']); ?></option>
								<?php endforeach; endif; else: echo "" ;endif; ?>
							</select>
						</div>
					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">社名</label>

						<div class="layui-input-block">

							<input type="text" name="title" value="<?php echo htmlentities($info['title']); ?>" lay-verify="required"
								placeholder="社名" autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">電話番号</label>

						<div class="layui-input-block">

							<input type="text" name="tel" value="<?php echo htmlentities($info['tel']); ?>" lay-verify="required"
								placeholder="電話番号" autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">所在地</label>

						<div class="layui-input-block">

							<input type="text" name="address" value="<?php echo htmlentities($info['address']); ?>"
								placeholder="所在地" autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">ウェブサイト</label>

						<div class="layui-input-block">

							<input type="text" name="web_url" value="<?php echo htmlentities($info['web_url']); ?>"
								placeholder="ウェブサイト" autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">備考</label>

						<div class="layui-input-block">

							<input type="text" name="content" value="<?php echo htmlentities($info['content']); ?>"
								placeholder="備考" autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item layui-layout-admin">

						<div class="layui-input-block">

							<div class="layui-footer" style="left: 0;">

								<button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">保存</button>

							</div>

						</div>

					</div>

				</form>

			</div>

		</div>

	</div>

	<script src="/public/static/layuiadmin/layui/layui.js"></script>

	<script>

		layui.config({

			base: '/public/static/layuiadmin/' // 静态资源所在路径

		}).extend({

			index: 'lib/index', // 主入口模块

			api: 'api'

		}).use(['index', 'form', 'laydate', 'api', 'upload'], function () {

			var $ = layui.$,

				admin = layui.admin,

				element = layui.element,

				layer = layui.layer,

				laydate = layui.laydate,

				api = layui.api,

				upload = layui.upload,

				form = layui.form;

			var industry_id = '';



			form.render(null, 'component-form-group');

			form.on('select(industry_id)', function (data) {
				if (data.value !== industry_id) {
					industry_id = data.value
					layer.load(1)
					api.ajax('<?php echo url("Classs/getClassData"); ?>', 'post', 'json', { industry_id: data.value }, function (res) {
						layer.closeAll('loading');
						if (res.code === 0) {
							var str = '<option value="">分類</option>'
							for (var i in res.data) {
								str += '<option value="' + res.data[i].id + '">' + res.data[i].title + '</option>'
							}
							// $("#class_id").html('')
							$("#class_id").html(str)
							form.render('select');
						}
					});
				}
			})

			/* 监听提交 */

			form.on('submit(component-form-demo1)', function (data) {

				var dats = data.field;

				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引

				layer.msg('読み込み中', {

					icon: 16,

					shade: 0.01

				});

				api.ajax('<?php echo url("save"); ?>', 'post', 'json', dats, function (res) {

					layer.closeAll('loading');

					layer.msg(res.msg);
					setTimeout(() => {
						parent.tables.reloads();
						parent.layer.close(index);
					}, 1000);

				});

				return false;

			});

		});

	</script>

</body>



</html>